home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / programming / other / gtlayout / source / ltp_drawprevnext.c < prev    next >
C/C++ Source or Header  |  1999-04-19  |  1KB  |  57 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1998 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #include "Assert.h"
  15.  
  16. #ifdef DO_TAPEDECK_KIND    /* Support code */
  17.  
  18. VOID
  19. LTP_DrawPrevNext(struct RastPort *RPort,BOOL Prev,LONG Left,LONG Top,LONG Width,LONG Height)
  20. {
  21.     LONG i,Len,Start,ArrowWidth,ArrowHeight,LineWidth,Pos;
  22.  
  23.     LineWidth    = (Width + 15) / 16;
  24.     ArrowWidth    = Width;
  25.     ArrowHeight    = Height;
  26.     Left        = Left - (LineWidth / 2);
  27.  
  28.     for(i = 0 ; i < ArrowWidth ; i++)
  29.     {
  30.         Len = ((ArrowHeight * (i + 1)) / ArrowWidth) & ~1;
  31.  
  32.         if(Len < ArrowHeight)
  33.             Len++;
  34.  
  35.         Start = Top + (ArrowHeight - Len) / 2;
  36.  
  37.         if(Prev)
  38.             Pos = Left + i;
  39.         else
  40.             Pos = Left + ArrowWidth - 1 - i;
  41.  
  42.         LTP_DrawLine(RPort,Pos,Start,Pos,Start + Len - 1);
  43.     }
  44.  
  45.     for(i = 0 ; i < LineWidth ; i++)
  46.     {
  47.         if(Prev)
  48.             Pos = Left + i;
  49.         else
  50.             Pos = Left + ArrowWidth - 1 - i;
  51.  
  52.         LTP_DrawLine(RPort,Pos,Top,Pos,Top + Height - 1);
  53.     }
  54. }
  55.  
  56. #endif    /* DO_TAPEDECK_KIND */
  57.